package org.lw.storm.kafka.example;

import java.net.InetAddress;
import java.net.UnknownHostException;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * 
 * @Description: 这个是log4j2的测试
 * @author wei.liu
 * @date 2017年2月23日 下午7:48:19
 * @version V1.0
 */
public class Main {
	public static void main(String[] args) throws UnknownHostException {
		Logger logger = LogManager.getLogger(LogManager.ROOT_LOGGER_NAME);
		logger.trace("trace level");
		logger.debug("debug level");
		logger.info("info level3333");
		logger.warn("warn level");
		logger.error("error level");
		logger.fatal("fatal level");
		Logger logger2 = LogManager.getLogger(Main.class);
		logger2.trace("trace level");
		logger2.debug("debug level");
		logger2.info("info level3333");
		logger2.warn("warn level");
		logger2.error("error level");
		logger2.fatal("fatal level");
		
		InetAddress addr = InetAddress.getLocalHost();
		String ip = addr.getHostAddress().toString();// 获得本机IP
		logger2.warn("ip:"+ip);
	}
}
